package com.iqiyi.pps.epg.web.timer;

import com.iqiyi.pps.epg.core.rpc.qipu.QipuService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by karkarrotxu on 2014/12/25.
 */
public class ProgramSyncTrigger {
    private static long repeat_time = 0;
    private static Logger logger = LoggerFactory.getLogger(ProgramSyncTrigger.class);
    @Autowired
    private QipuService qipuService;

    public void task() {
        repeat_time ++;
        long startTime = System.currentTimeMillis();
        logger.info("[ProgramSyncTrigger] task : "+repeat_time);
        qipuService.syncProgramDataList(true);
        long endTime = System.currentTimeMillis();
        logger.info("[ProgramSyncTrigger] end : "+(endTime - startTime ));
    }

}
